<?php

include('../../include/functions.inc.php');
include('../../include/maintenance.inc.php');

if (!isset($_SESSION['mTeacher'])) {
    $mTeacher = new Maintenance();

    $mTeacher->windowTitle = 'Mantenimiento de Catedraticos';
    $mTeacher->newUrlPage = 'new.php';
    $mTeacher->editUrlPage = 'edit.php';
    $mTeacher->saveNewUrlPage = 'data.php?operation=s';
    $mTeacher->updateUrlPage = 'data.php?operation=u';
    $mTeacher->deleteUrlPage = 'data.php?operation=d';
    $mTeacher->listJsonUrl = 'list.php';
    $mTeacher->path = '../../';
    $mTeacher->staticsUrl = 'index.php?statics=true';
    $mTeacher->editUrlParams = array("ID" => "ID");
    $mTeacher->deleteUrlParams = array("ID" => "ID");
    $mTeacher->table = "cllg_teacher";
    $mTeacher->globalCallBackJs = "config.js.php";
    $mTeacher->validations = array("required,ID,Identifiacion es Requerido",
        "required,FIRST_NAME,Nombres es Requerido",
        "required,LAST_NAME,Apellidos es Requerido");
    $mTeacher->loadDynValidations($db);
    $mTeacher->panels = TRUE;
    $_SESSION['mTeacher'] = serialize($mTeacher);
} else {
    $mTeacher = unserialize($_SESSION['mTeacher']);
}

if (!isEmpty(getParam('statics'))) {
    $mTeacher->statics(count($db->query_select('cllg_teacher')));
} else {
    $mTeacher->build();
}
?>